/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package dunify;

import java.util.ArrayList;
import java.util.Collection;
import lunify.LProcessor;
import lunify.Source;

/**
 *
 * @author katie
 */
public class Dictionary extends Source {

    @Override
    public LProcessor processor(String name) {
        try {
            return EDict.valueOf(name).get();
        } catch (Exception e) {
            return null;
        }
    }

    @Override
    public Collection<String> options() {
        ArrayList<String> out = new ArrayList<String>();
        for(EDict ed : EDict.values()){
            out.add(ed.toString());
        }
        return out;
    }
}

enum EDict {

    OMEGA {
        @Override
        public LProcessor get() {
            return new Omega();
        }
    }, UNI {
        @Override
        public LProcessor get() {
            return new Uni();
        }
    }, WIK {
        @Override
        public LProcessor get() {
            return new Wik();
        }
    }, WIKI {
        @Override
        public LProcessor get() {
            return new Wiki();
        }
    };

    public LProcessor get() {
        return null;
    }
}